package com.ruoyi.core.lock;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ULock {

    /**
     * Automatically unlock max time.
     */
    long maxTimeout() default 10L;

    /**
     * Max await fetch lock time.
     */
    long awaitTimeout() default 10L;

    /**
     * Lock key.Default used current login userId
     */
    String lockKey() default "";

    /**
     * Lock Ip
     */
    boolean lockIp() default false;

    /**
     * Request interval
     */
    int interval() default -1;

    /**
     * Use Function Name.
     */
    boolean useMethodName() default true;


}
